<template>
    <div class="top-button-wrapper" @click="backTopEvent"></div>
</template>

<script>
    export default {
        name: "TopButton",
      methods: {
        backTopEvent() {
          window.scrollTo(0, 0);
        }
      }
    };
</script>

<style lang="less">
.top-button-wrapper {
  position: fixed;
  bottom: 40px;
  right: 40px;
  z-index: 100;
  width: 40px;
  height: 40px;
  background-image: url("../assets/imgs/backtop.png");
  background-position: center;
  background-repeat: no-repeat;
  background-color: rgba(48,28,127, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  cursor: pointer;
}
@media screen and (max-width: 768px) {
  .top-button-wrapper {
    position: fixed;
    bottom: 40px;
    right: 20px;
    z-index: 100;
    width: 40px;
    height: 40px;
    background-image: url("../assets/imgs/backtop.png");
    background-position: center;
    background-repeat: no-repeat;
    background-color: rgba(48,28,127, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    cursor: pointer;
  }
}
</style>
